package com.rerun.common.util;

import java.util.List;

/**
 * @author dax.
 * @version v1.0
 * @since 2017/10/17 13:20
 */

public class StringUtil {

    public static String listToStr(List list, char separator) {
        StringBuilder sb = new StringBuilder();
        if (list!=null&&!list.isEmpty()){
            for (Object aList : list) {
                sb.append(aList).append(separator);
            }
        }

        return sb.length()>0? sb.toString().substring(0, sb.toString().length() - 1):null;
    }
}
